package com.paomi.client.activity.shopCar;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseViewHolder;
import com.paomi.client.R;
import com.paomi.client.activity.shopCar.adapter.ShopListAdapter;
import com.paomi.client.activity.shopCar.model.ShopBean;
import com.paomi.client.base.BaseLCEActivity;
import com.paomi.client.utils.UIUtils;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ShopsCarActivity extends BaseLCEActivity<ShopBean, ShopListPresenter> {


    @BindView(R.id.recycler_list)
    RecyclerView recyclerList;
    @BindView(R.id.all_check)
    TextView allCheck;
    @BindView(R.id.all_btn)
    TextView allBtn;
    @BindView(R.id.sum_money)
    TextView sumMoney;
    @BindView(R.id.btn_pay)
    Button btnPay;
    private ShopListAdapter shopListAdapter;
    private List<String> list=new ArrayList();

    @NonNull
    @Override
    public ShopListPresenter createPresenter() {
        return new ShopListPresenter();
    }

    @Override
    protected String setTitle() {
        return getResources().getString(R.string.shopCars_title);
    }

    @Override
    protected void showBack(TextView button_goback) {
        button_goback.setVisibility(View.VISIBLE);
        button_goback.setTypeface(iconfont);
        button_goback.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
        button_goback.setTextColor(getResources().getColor(R.color.main_color));
        button_goback.setText(getResources().getString(R.string.back_normal) + getResources().getString(R.string.back));
    }

    @NonNull
    @Override
    protected int getLayoutId() {
        return R.layout.activity_shops_car;
    }

    @Override
    protected void initEvent() {
        super.initEvent();
        recyclerList.setLayoutManager(UIUtils.getRecyclerViewManager(false,this));
        for (int i = 0; i < 2; i++) {
            list.add(i + "");
        }
    }

    @NonNull
    @Override
    protected RecyclerView createRecycler() {
        return recyclerList;
    }

    @Override
    protected int getItemLayout() {
        return R.layout.item_list_shop;
    }

    @Override
    protected void initEmpty(TextView empty) {

    }

    @Override
    protected void convert(BaseViewHolder helper, ShopBean item) {
        RecyclerView recyclerView = helper.itemView.findViewById(R.id.recycler_list);
        recyclerView.setLayoutManager(UIUtils.getRecyclerViewManager(false,this));
        shopListAdapter = new ShopListAdapter(this);
        recyclerView.setAdapter(shopListAdapter);
        shopListAdapter.setData(list);
    }

    @Override
    protected void onItemClick(View view, ShopBean item) {

    }

    @OnClick({R.id.all_btn, R.id.btn_pay})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.all_btn:
                break;
            case R.id.btn_pay:
                break;
        }
    }
}
